<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .z_index_decr div {
            width: 100px;
            height: 100px;
            position: absolute;
            line-height: 100px;
            text-align: center;
        }
    </style>
</head>

<body>
    <!-- z-index使用 -->
    <div class="z_index_decr">
        <div style="background-color: #f00;z-index:10;left: 200px;">
            A-10
            <div style="background-color: #0f0; z-index: 11;left: 10px;top: 90px;">A1-11</div>
            <div style="background-color: #00f; z-index: -1;left: 70px;top:80px">A2--1</div>
        </div>
        <div style="background-color: #ff0; z-index: 50;left: 290px;top:30px">B-50</div>
    </div>
    <!--  -->
</body>
<!-- 层级计算 -->
<!-- 
A —— z-index = 10
A1 —— z-index = 10.100
A2 —— z-index = 10.150
B —— z-index = 50 
-->

</html>